import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/drug/list',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: '/drug/add',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/drug/edit',
    method: 'put',
    data
  })
}

export function editPic(data) {
  return request({
    url: '/drug/edit-drug-pic',
    method: 'put',
    data
  })
}

export function del(data) {
  return request({
    url: '/drug/remove/'+data,
    method: 'delete',
    data
  })
}

export function getListByPinyinCode(pinyinCode) {
  return request({
    url: '/drug/query-by-pinyin-code/'+pinyinCode,
    method: 'get',
  })
}

export function getListByPinyinCodeAndOptType(pinyinCode, optType) {
  return request({
    url: '/drug/query-by-pinyin-code/'+pinyinCode + '/' + optType,
    method: 'get',
  })
}

export function getListByPinyinCodeProductTime(pinyinCode, depositoryIds, type) {
  return request({
    url: '/drug/query-by-pinyin-code-productTime/'+ pinyinCode + '/' + depositoryIds + '/' + type,
    method: 'get',
  })
}
export function queryByCodes(params) {
  return request({
    url: '/drug/drug-detail-by-codes',
    method: 'get',
    params
  })
}

export function queryByCodeAnDepositoryId(params) {
  return request({
    url: '/drug/query-by-code-depositoryId',
    method: 'get',
    params
  })
}

export function queryDepositoryNumList(params) {
  return request({
    url: '/drug/depository-num-list',
    method: 'get',
    params
  })
}

export function queryDepositoryNumDetail(params) {
  return request({
    url: '/drug/depository-num-detail',
    method: 'get',
    params
  })
}

export function getDrugCode(params) {
  return request({
    url: '/drug/get-drug-code',
    method: 'get',
    params
  })
}
export function getPic(id) {
  return request({
    url: '/drug/query-pic-by-id/'+id,
    method: 'get',
  })
}

export function allDrugDepositoryNum(params) {
  return request({
    url: '/drug/all-drug-depository-num',
    method: 'get',
    params
  })
}

export function drugDepositoryNum(params) {
  return request({
    url: '/drug/drug-depository-num',
    method: 'get',
    params
  })
}
